<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单控制</title>
</head>
<body>
    <form action="" name="hd">
        <input type="text" name="title" />
    </form>
</body>

<script>
    // const form = document.forms.hd;
    // console.log(form.elements.title);
    // console.log(form.title);//获取name为title的元素

    //通过表单项可以反向查找form
    // const form = document.forms.hd;
    // console.log(form.title.form === form);


</script>

</html>
